package com.sunyard.domee.common.enums;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

/**
 * @program domee
 * @description
 * @author raoinyx@163.com
 * @create 2020-07-18 00:23
 */
@Getter
@RequiredArgsConstructor
public enum AccountStatusEnum {
    /**
     * 启用
     */
    ENABLE(0,"启用"),
    /**
     * 冻结
     */
    DISABLE(1,"冻结"),
    /**
     * 离职
     */
    LEAVE(2,"离职"),




    ;
    /**
     * 状态码
     */
    private final Integer code;
    /**
     * 状态描述
     */
    private final String message;


    public static AccountStatusEnum getEnumByCode(Integer code) {
        AccountStatusEnum[] enums = AccountStatusEnum.values();
        for (AccountStatusEnum accountStatusEnum : enums) {
            if (accountStatusEnum.getCode().equals(code)) {
                return accountStatusEnum;
            }
        }
        return null;
    }
}
